﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateUser.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="ManageBanking.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  
    <script src="../../Scripts/smartpaginator.js" type="text/javascript"></script>

    <link href="../../Content/css/smartpaginator.css" rel="stylesheet" type="text/css" />
     <script src="../../Scripts/JTPS.js" type="text/javascript"></script>

   
    
    

    <link href="../../Content/css/screen.css" rel="stylesheet" type="text/css" />
 <%-- <link href="../../Areas/Admin/Content/css/screen.css" rel="stylesheet" type="text/css" />--%>
    <script type="text/javascript" language="javascript">

      $(document).ready(function() {
       
      $('#empTable').jTPS({clickCallback: function() {
              // target table selector
      var table = '#empTable';
              // store pagination + sort in cookie 
              document.cookie = 'jTPS=sortasc:' + $(table + ' .sortableHeader').index($(table + ' .sortAsc')) + ',' +
                                                'sortdesc:' + $(table + ' .sortableHeader').index($(table + ' .sortDesc')) + ';';
              $('.stubCell').remove();
          }
      });
          

          // reinstate sort and pagination if cookie exists
          var cookies = document.cookie.split(';');
          for (var ci = 0, cie = cookies.length; ci < cie; ci++) {
              var cookie = cookies[ci].split('=');
              if (cookie[0] == 'jTPS') {
                  var commands = cookie[1].split(',');
                  for (var cm = 0, cme = commands.length; cm < cme; cm++) {
                      var command = commands[cm].split(':');
                      if (command[0] == 'sortasc' && parseInt(command[1]) >= 0) {
                          $('#empTable .sortableHeader:eq(' + parseInt(command[1]) + ')').click();
                      } else if (command[0] == 'sortdesc' && parseInt(command[1]) >= 0) {
                          $('#empTable .sortableHeader:eq(' + parseInt(command[1]) + ')').click().click();
                      } 
                  }
              }
          }
          $('.stubCell').remove();
          // bind mouseover for each tbody row and change cell (td) hover style
          $('#empTable tbody tr:not(.stubCell)').bind('mouseover mouseout',
                                function(e) {
                                    // hilight the row
                                    e.type == 'mouseover' ? $(this).children('td').addClass('hilightRow') : $(this).children('td').removeClass('hilightRow');
                                }
                        );

      });

     
        </script>
        
    <script type="text/javascript">
        $(document).ready(function() {

            $("select#perpage").change(function() {
                var str;
                $("select option:selected").each(function() {
                    str = parseInt($(this).text());
                });


                $('#red').smartpaginator({ totalrecords: $('input#totaluser').attr('value'), recordsperpage: str, length: 4, datacontainer: 'empTable', dataelement: 'tr', next: 'Next', prev: 'Prev', first: 'First', last: 'Last', theme: 'black', controlsalways: true, onchange: function(newPage) {
                    $('#r').html('Page # ' + newPage);
                }
                });

                $('.short').remove();


            }).change();
        });
    </script>
    
      
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

 


<%         
        List<decimal> money = (List<decimal>)ViewData["money"];
        List<InformationAccount> ac = (List<InformationAccount>)ViewData["info"];
        
        
         %>
   <table id="empTable" class="empTable3 empTable1" border="0"  cellpadding="0" cellspacing="0" >
	 <thead>
	<tr>
		<th sort="index" class="table-header-account th-detailacc-idaccount"><a>ID Account</a>	</th>
		<th  sort="description" class="table-header-repeat line-left th-detailacc-name"><a>Name</a></th>
		<th sort="date" class="table-header-repeat line-left th-detailacc-date"><a>Creation Date</a></th>
		<th sort="Total" class="table-header-repeat line-left th-detailacc-Balance"><a>Balance</a></th>
		<th sort="description" class="table-header-options line-left th-detailacc-options"><a>Options</a></th>
	</tr>
	</thead>
	  <tbody>
	<%  int dem = 1;
        for (int i = 0; i < ac.Count; i++)
        {%>
	            <tr class="alternate-row">
		            <td align="center" class="lock"><%=ac[i].IdAccount %></td>
		            <td align="center" class=""><%=ac[i].Name %></td>
		            <td align="center" class="lock"><%=ac[i].DateCreate.Value.ToString("yyyy-MM-dd") %></td>
		            <td align="center" class="lock">$
		           <%= money[i].ToString("#,## ;#.##0.00'-';0 ")%>   
                     
		            </td>
		            <td class="options-width1">
                        <label title="Transfer"><a href='<%=Url.Action("Transfer/"+ac[i].IdAccount+"/"+money[i],"T_Account") %>'  class="icon-3 " > </a></label>
                       
                        
                        <label title="Cheque"><a  href='<%=Url.Action("AddCheque/"+ac[i].IdAccount+"/"+money[i],"Cheque") %>'  class="icon-4 info-tooltip"></a></label>
                        <label title="History"><a href='<%= Url.Action("ListHistory/" + ac[i].IdAccount +"/all/all"  , "HistoryUser") %>'  class="icon-6 info-tooltip"></a></label>
		            </td>
	            </tr>
	        
	            
	<%  
        }
	     %>
	       </tbody>
	</table>
	<!--  end product-table................................... --> 
	

    <!--  start paging..................................................... -->
	<div id="red" style="margin: auto;">
	     <input id="totaluser" type="hidden" value='<%= ViewData["totaluser"]%>'  />
	</div>
	
	<div id="drop" >
	    <select id="perpage" >   
            <option value="2">2</option>
			<option selected="selected" value="5">5</option>
			<option value="10">10</option>
			<option value="15">15</option>
			<option value="20">20</option>
			<option value="30">30</option>
		</select>
	</div>
	<!--  end paging................ -->


</asp:Content>
